package io.command;

import io.IIO;
import card.Cardset;
import io.command.result.IOResult;
import io.command.result.IOCharResult;

/**
 * Command for show confirmed player's play
 * 
 * 
 * @version 1.0.2
 */
public class ConfirmPlayCommand extends IOCommand {

	private Cardset play;

	public ConfirmPlayCommand(IIO io, Cardset play) {
		super(io);
		this.play = play;
	}

	/**
	 * Command details
	 */
	@Override
	public IOResult execute() {

		char choice;

		io.println("Here is your play: ");
		io.print(play);

		do {
			io.println("Input 'c' to confirm, 'r' to reset");
			choice = io.getNextInput().charAt(0);
		} while (choice != 'c' && choice != 'r');

		return new IOCharResult(choice);
	}

}
